<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>Document</title>
  <style>
    
  </style>
</head>
<body>
  
</body>
<script>

  // console.log(localStorage);
  // console.log(window.localStorage);
  // console.log(window.localStorage === localStorage);
  
  // localStorage.xxx = "hello world";
  // delete localStorage.xxx;
  // console.log(localStorage);
  // console.log(localStorage.xxx);
  // console.log(localStorage.length);

  // ==========
  
  // localStorage.setItem("msg", "123");

  // console.log(localStorage.getItem("msg"));

  // localStorage.setItem("msg", "zxc")

  // localStorage.setItem("msg2", "zxc")

  // localStorage.removeItem("msg")

  // 慎用
  // localStorage.clear();
  
  // console.log(localStorage)


  // 会话级：关闭浏览器即删除
  // sessionStorage.setItem("msg", "world")
  // console.log(sessionStorage)
</script>
</html>